function save() {
	document.getElementsByName("");
	if ($("#name").val() == null || $("#name").val() == "") {
		alert("角色名称不可为空");
		$("#name").focus();
		return;
	}
	document.saverole.action = "saverole.vm";
	document.saverole.submit();
}
function uprole() {
	if ($("#name").val() == null || $("#name").val() == "") {
		alert("角色名称不可为空");
		$("#name").focus();
		return;
	}
	document.saverole.action = "uprole.vm";
	document.saverole.submit();
}

function de_power(id) {
	var bool = window.confirm("此操作将会删除该角色及该角色下的人员,您确定删除吗?");
	if (bool == true) {
		window.location.href = "derole.vm?id=" + id;
	}
}

function uppo() {
	document.uppower.action = "uppower.vm";
	document.uppower.submit();
}

// 会议室权限 全选
function hys_quan() {

	if (document.getElementById("hys").checked == true)

	{   document.getElementById("ylhys").checked = true;
		document.getElementById("cxyd").checked = true;
		document.getElementById("wdyd").checked = true;
		document.getElementById("hysgl").checked = true;
		
		document.getElementById("ggms").checked = true;
		document.getElementById("ggyx").checked = true;
		document.getElementById("bore").checked = true;
		document.getElementById("bore").value = 1;
		document.getElementById("ggyx").value = 1;
		document.getElementById("ggms").value = 1;
		document.getElementById("hysgl").value = 1;
		
		document.getElementById("cxyd").value = 1;
		document.getElementById("wdyd").value = 1;
		document.getElementById("ylhys").value = 1;
	} else {
		document.getElementById("ylhys").checked = false;
		document.getElementById("hysgl").checked = false;
		
		document.getElementById("ggms").checked = false;
		document.getElementById("ggyx").checked = false;
		document.getElementById("bore").checked = false;
		document.getElementById("cxyd").checked = false;
		document.getElementById("wdyd").checked = false;
		document.getElementById("bore").value = 0;
		document.getElementById("ggyx").value = 0;
		document.getElementById("ggms").value = 0;
		document.getElementById("hysgl").value = 0;
	
		document.getElementById("cxyd").value = 0;
		document.getElementById("wdyd").value = 0;
		document.getElementById("ylhys").value = 0;
	}
}
// 会议室管理
function hysgl_check() {
	if (document.getElementById("hysgl").checked == true) {
		document.getElementById("hysgl").checked == true;
		document.getElementById("hysgl").value = 1;

	} else {
		document.getElementById("hysgl").checked == false;
		document.getElementById("hysgl").value = 0;
	}
}

function grgl_check() {
	if (document.getElementById("grgl").checked == true) {
		document.getElementById("grgl").checked == true;
		document.getElementById("grgl").value = 1;

	} else {
		document.getElementById("grgl").checked == false;
		document.getElementById("grgl").value = 0;
	}
}

function cxyd_check() {
	if (document.getElementById("cxyd").checked == true) {
		document.getElementById("cxyd").checked == true;
		document.getElementById("cxyd").value = 1;

	} else {
		document.getElementById("cxyd").checked == false;
		document.getElementById("cxyd").value = 0;
	}
}

function ylhys_check() {
	if (document.getElementById("ylhys").checked == true) {
		document.getElementById("ylhys").checked == true;
		document.getElementById("ylhys").value = 1;

	} else {
		document.getElementById("ylhys").checked == false;
		document.getElementById("ylhys").value = 0;
	}
}

function wdyd_check() {
	if (document.getElementById("wdyd").checked == true) {
		document.getElementById("wdyd").checked == true;
		document.getElementById("wdyd").value = 1;

	} else {
		document.getElementById("wdyd").checked == false;
		document.getElementById("wdyd").value = 0;
	}
}
// 显示时间管理
function bore_check() {
	if (document.getElementById("bore").checked == true) {
		document.getElementById("bore").checked == true;
		document.getElementById("bore").value = 1;

	} else {
		document.getElementById("bore").checked == false;
		document.getElementById("bore").value = 0;
	}
}

// 设备管理
function sbgl_check() {
	if (document.getElementById("sbgl").checked == true) {
		document.getElementById("sbgl").checked == true;
		document.getElementById("sbgl").value = 1;

	} else {
		document.getElementById("sbgl").checked == false;
		document.getElementById("sbgl").value = 0;
	}
}

// 部门管理
function bmgl_check() {
	if (document.getElementById("bmgl").checked == true) {
		document.getElementById("bmgl").checked == true;
		document.getElementById("bmgl").value = 1;
	} else {
		document.getElementById("bmgl").checked == false;
		document.getElementById("bmgl").value = 0;

	}
}
// 员工管理
function yhgl_check() {
	if (document.getElementById("yhgl").checked == true) {
		document.getElementById("yhgl").checked == true;
		document.getElementById("yhgl").value = 1;

	} else {
		document.getElementById("yhgl").checked == false;
		document.getElementById("yhgl").value = 0;
	}
}
function wxsp_check() {
	if (document.getElementById("wxsp").checked == true) {
		document.getElementById("wxsp").checked == true;
		document.getElementById("wxsp").value = 1;

	} else {
		document.getElementById("wxsp").checked == false;
		document.getElementById("wxsp").value = 0;
	}
}
// 角色管理
function jsgl_check() {
	if (document.getElementById("jsgl").checked == true) {
		document.getElementById("jsgl").checked == true;
		document.getElementById("jsgl").value = 1;
	} else {
		document.getElementById("jsgl").checked == false;
		document.getElementById("jsgl").value = 0;

	}
}

// 公共短信管理
function ggms_check() {
	if (document.getElementById("ggms").checked == true) {
		document.getElementById("ggms").checked == true;
		document.getElementById("ggms").value = 1;
	} else {
		document.getElementById("ggms").checked == false;
		document.getElementById("ggms").value = 0;

	}
}

// 公共邮箱管理
function ggyx_check() {
	if (document.getElementById("ggyx").checked == true) {
		document.getElementById("ggyx").checked == true;
		document.getElementById("ggyx").value = 1;
	} else {
		document.getElementById("ggyx").checked == false;
		document.getElementById("ggyx").value = 0;

	}
}

// 会议服务
function hyfw_check() {
	if (document.getElementById("hyfw").checked == true) {
		document.getElementById("hyfw").checked == true;
		document.getElementById("hyfw").value = 1;
	} else {
		document.getElementById("hyfw").checked == false;
		document.getElementById("hyfw").value = 0;

	}
}
// 服务考核
function fwkh_check() {
	if (document.getElementById("fwkh").checked == true) {
		document.getElementById("fwkh").checked == true;
		document.getElementById("fwkh").value = 1;
	} else {
		document.getElementById("fwkh").checked == false;
		document.getElementById("fwkh").value = 0;

	}
}
// 会议审批
function hysp_check() {
	if (document.getElementById("hysp").checked == true) {
		document.getElementById("hysp").checked == true;
		document.getElementById("hysp").value = 1;
	} else {
		document.getElementById("hysp").checked == false;
		document.getElementById("hysp").value = 0;

	}
}
function sbtj_check() {
	if (document.getElementById("tjsb").checked == true) {
		document.getElementById("tjsb").checked == true;
		document.getElementById("tjsb").value = 1;
	} else {
		document.getElementById("tjsb").checked == false;
		document.getElementById("tjsb").value = 0;

	}
}
function wxsp_check() {
	if (document.getElementById("wxsp").checked == true) {
		document.getElementById("wxsp").checked == true;
		document.getElementById("wxsp").value = 1;
	} else {
		document.getElementById("wxsp").checked == false;
		document.getElementById("wxsp").value = 0;

	}
}
function seehysp_check() {
	if (document.getElementById("seehysp").checked == true) {
		document.getElementById("seehysp").checked == true;
		document.getElementById("seehysp").value = 1;
	} else {
		document.getElementById("seehysp").checked == false;
		document.getElementById("seehysp").value = 0;

	}
}
// 用户管理 权限 全选
function yh_quan() {
	if (document.getElementById("yh").checked == true) {
		document.getElementById("tjsb").checked = true;
		document.getElementById("hysp").checked = true;
		document.getElementById("seehysp").checked = true;
		document.getElementById("wxsp").checked = true;
		document.getElementById("bmgl").checked = true;
		document.getElementById("jsgl").checked = true;
		document.getElementById("yhgl").checked = true;
		document.getElementById("grgl").checked = true;
		document.getElementById("grgl").value = 1;

		document.getElementById("bmgl").value = 1;
		document.getElementById("jsgl").value = 1;
		document.getElementById("yhgl").value = 1;
		document.getElementById("hysp").value = 1;
		document.getElementById("seehysp").value = 1;
		document.getElementById("tjsb").value = 1;
		document.getElementById("wxsp").value = 1;
	} else

	{
		document.getElementById("wxsp").checked = false;
		document.getElementById("hysp").checked = false;
		document.getElementById("seehysp").checked=false;
		document.getElementById("bmgl").checked = false;
		document.getElementById("jsgl").checked = false;
		document.getElementById("yhgl").checked = false;
		document.getElementById("tjsb").checked = false;
		document.getElementById("grgl").checked =false;
		document.getElementById("grgl").value = 0;
		document.getElementById("bmgl").value = 0;
		document.getElementById("jsgl").value = 0;
		document.getElementById("yhgl").value = 0;
		document.getElementById("hysp").value = 0;
		document.getElementById("seehysp").value = 0;
		document.getElementById("tjsb").value = 0;
		document.getElementById("wxsp").value = 0;
	}
}
// 服务权限 全选
function fw_quan() {
	if (document.getElementById("fw").checked == true) {
		document.getElementById("hyfw").checked = true;
		document.getElementById("fwkh").checked = true;
		document.getElementById("hyfw").value = 1;
		document.getElementById("fwkh").value = 1;
	} else

	{
		document.getElementById("hyfw").checked = false;
		document.getElementById("fwkh").checked = false;
		document.getElementById("hyfw").value = 0;
		document.getElementById("fwkh").value = 0;
	}
}
